home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist6.3 / ViewKit_dev.idb / usr / include / Vk / VkMacros.h.z / VkMacros.h
C/C++ Source or Header  |  1996-09-20  |  3KB  |  79 lines

  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///////   Copyright 1992, Silicon Graphics, Inc.  All Rights Reserved.   ///////
  3. //                                                                            //
  4. // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;     //
  5. // the contents of this file may not be disclosed to third parties, copied    //
  6. // or duplicated in any form, in whole or in part, without the prior written  //
  7. // permission of Silicon Graphics, Inc.                                       //
  8. //                                                                            //
  9. // RESTRICTED RIGHTS LEGEND:                                                  //
  10. // Use,duplication or disclosure by the Government is subject to restrictions //
  11. // as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data     //
  12. // and Computer Software clause at DFARS 252.227-7013, and/or in similar or   //
  13. // successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -    //
  14. // rights reserved under the Copyright Laws of the United States.             //
  15. //                                                                            //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. #ifndef _4SpeedMacros_ 
  18. #define _4SpeedMacros_
  19.  
  20. #define VkDBGFUNCENTRY            0x001
  21. #define VkDBGFUNCEXIT            0x002
  22. #define VkDBGCALLBACKENTRY        0x004    
  23. #define VkDBGCALLBACKEXIT        0x008    
  24. #define VkDBGLOOPENTRY            0x010    
  25. #define VkDBGLOOPEXIT            0x020    
  26. #define VkDBGLOOP            0x040    
  27. #define VkDBGRESERVED            0x080    
  28.  
  29. #ifndef NODEBUG
  30. #define NODEBUG
  31.  
  32. #include <stdio.h>
  33.  
  34. extern unsigned int VkDebugLevel;
  35.  
  36. //
  37. // Use Vk*Debug() to trace various actions in the application
  38. //   VkSODebug - Viewkit Standard Out Debugging message
  39. //   VkSEDebug - Viewkit Standard Error Debugging message
  40. //   VkFDebug  - Viewkit Debugging message written to File
  41. //               you must provide the file descriptor as the first argument
  42. //
  43.  
  44. #define VkSODebug(LEVEL,FORMAT) \
  45.     if (::VkDebugLevel & (LEVEL)) { printf FORMAT; fflush (stdout); }
  46.  
  47. #define VkSEDebug(LEVEL,STRING) \
  48.     if (::VkDebugLevel & (LEVEL)) fprintf (stderr, "%s", STRING);
  49.  
  50. #define VkFDebug(LEVEL,FORMAT) \
  51.     if (::VkDebugLevel & (LEVEL)) fprintf FORMAT;
  52.  
  53. //
  54. // Use Vk*assert() to check for assumptions or boundary conditions in the app.
  55. //   VkSOAssert - Viewkit Standard Out Assertion message
  56. //   VkSEAssert - Viewkit Standard Error Assertion message
  57. //   VkFAssert  - Viewkit Assertion message written to File
  58. //
  59.  
  60. #define VkSOAssert(CONDITION, FORMAT) if (!(CONDITION)) \
  61.     { printf FORMAT; fflush (stdout); }
  62.  
  63. #define VkSEAssert(CONDITION, MESSAGE) if (!(CONDITION)) \
  64.     { fprintf (stderr, "%s", MESSAGE); }
  65.  
  66. #define VkFAssert(CONDITION, MESSAGE) if (!(CONDITION)) \
  67.     fprintf MESSAGE;
  68.  
  69. #else
  70. #define VkFDebug(LEVEL, FORMAT)
  71. #define VkSODebug(LEVEL, FORMAT)
  72. #define VkSEDebug(LEVEL, FORMAT)
  73. #define VkFAssert(CONDITION, FORMAT)
  74. #define VkSOAssert(CONDITION, FORMAT)
  75. #define VkSEAssert(CONDITION, FORMAT)
  76. #endif
  77.  
  78. #endif
  79.